package com.wangcp.utils;

import lombok.Data;

import java.util.Date;

/**
* 日期区间类
* @author wangcp
* @date 2021/12/29 10:06
**/
@Data
public class RangeDate {
    Date start;
    Date end;

    private RangeDate(Date start) {
        this.start = start;
    }

    public static RangeDate create(Date start) {
        return new RangeDate(start);
    }

    public RangeDate end(Date end) {
        this.end = end;
        return this;
    }


    public String toString() {
        return "[" + cn.hutool.core.date.DateUtil.format(start, "yyyy-MM-dd") + "-" + cn.hutool.core.date.DateUtil.format(end, "yyyy-MM-dd")
                + "]";
    }
}
